/*
 * 双重锁
 * 
 * 结合懒汉式、饿汉式。即保证效率也实现延时加载。
 */
public class Singleton_doublecheck {
    private static volatile Singleton_doublecheck mInstance = null;

    private Singleton_doublecheck(){ 
    }

    public static Singleton_doublecheck getInstance(){
        if (mInstance==null) {
            synchronized(Singleton_doublecheck.class){
                if (mInstance==null) {
                    mInstance =new Singleton_doublecheck();
                }
            }
        }
        return mInstance;
    }
}
